#include"server.hpp"

static void Usage(string proc)
{
    cout<<"\nUsage:\n\t"<<proc<<" local_port\n\t";
}

void handler(string clientip,uint16_t clientport,string message)
{
    cout<<"hander"<<endl;
}

int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }

    uint16_t port = atoi(argv[1]);

    unique_ptr<server> user(new server(handler,port));

    user->initServer();
    user->start();

    return 0;
}